<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
//JHtml::_('behavior.tooltip');
JPluginHelper::importPlugin('content');
$dispatcher	= JDispatcher::getInstance();
if (!class_exists('plgContentLightShop')) {
	JError::raiseWarning(50, str_rot13('WYVO_FUBC_REEBE_YBNQ_CYHTVA'));
}
?>
<link rel="stylesheet" href="<?php echo JURI::root().'components/com_shop/assets/'; ?>cart.css" type="text/css" />
<form action="<?php echo JRoute::_('index.php?option=com_shop&task=cart.update'); ?>" method="post" enctype="multipart/form-data" class="shop-orcer" id="shop-order">
<table  class="viewcart" width="100%" cellpadding="0" cellspacing="0">
<thead>	<tr><td colspan="4"><div class="title_cart">Giỏ hàng</div></td></tr></thead>
<tbody>
	<tr>
    	<td class="title_cart_product">Ảnh</td><td class="title_cart_product">Đơn giá</td><td class="title_cart_product">Số lượng</td><td class="title_cart_product">Tổng giá</td>
    </tr>
    <?php foreach($this->carts as $cart):?>
    <tr>
    	<td>
        	<a href="<?php echo JRoute::_('index.php?option=com_shop&view=detail&id='.$cart['id'].':'.$cart['alias']); ?>"><img src="<?php echo $this->path_img.$cart['image']; ?>" title="<?php echo $cart['title']; ?>" width="100" height="100" /></a>
        </td>
        <td>
        <?php $dispatcher->trigger('onFormatPrice',array($cart['price'],$cart['currency'],&$price)); echo $price; ?>
        </td>
        <td>
        <input type="text" name="quantity[]" value="<?php echo $cart['quantity']; ?>" size="2" />
        <a rel="nofollow" href="javascript:;" onclick="updateshop();"><img src="<?php echo JURI::root().'components/com_shop/assets/update.png'; ?>" /></a>
        </td>
        <td>
<?php $dispatcher->trigger('onFormatPrice',array($cart['price']*$cart['quantity'],$cart['currency'],&$price)); echo $price; ?>
        </td>
    </tr>
    <?php endforeach;?>
</tbody>
</table>
</form>
<script type="text/javascript">
function updateshop()
{
	var $doc = document.getElementById('shop-order'); $doc.submit();
}
</script>